package ragserverengine.milvus

import io.ktor.server.application.call
import io.ktor.server.request.receive
import io.ktor.server.response.respond
import io.ktor.server.routing.*


fun Route.MiluvsRoutes(){

    val service = MilvusService(application)

    post("/milvus/insert") {

        // 拿请求
        val request = call.receive<MilvusRequest>()

        // 转发
        val responsed = service.insert(request)

        // 返回结果
        call.respond(responsed)

    }

    post("/milvus/search"){

        val request = call.receive<MilvusSearchRequest>()

        val reponsed = service.search(request)

        call.respond(reponsed)

    }

    post("/delete") {  }

    post("/index") {  }

}